import { promises } from 'dns'

import { ajax } from '@/utils'

import { qzyLotteryEditItem, qzyLotteryItem } from './qzyType'

export default {
  /** 库存日志列表 */
  getLogList(data: any): Promise<any> {
    return ajax.post(
      '/yswy-qingziyan-back-service/draw/findFragmentsStockLog',
      data
    )
  },
  //**抽奖记录列表 */
  getLotteryRecordList(data: any): Promise<any> {
    return ajax.post('/yswy-qingziyan-back-service/draw/findDrawLog', data)
  },
  //**抽奖活动列表 */
  getLotteryActivityList(data: any): Promise<any> {
    return ajax.post('/yswy-qingziyan-back-service/draw/findDrawActivity', data)
  },
  //**创建抽奖活动 */
  createLotteryActivity(data: any): Promise<qzyLotteryItem> {
    return ajax.post(
      '/yswy-qingziyan-back-service/draw/createDrawActivity',
      data
    )
  },
  //**编辑抽奖活动 */
  editLotteryActivity(data: any): Promise<qzyLotteryItem> {
    return ajax.post('/yswy-qingziyan-back-service/draw/editDrawActivity', data)
  },
  //**抽奖活动详情 */
  qzyLotterylDetail(data: any): Promise<any> {
    return ajax.post('/yswy-qingziyan-back-service/draw/getDrawActivity', data)
  },
  //**进行中的活动增加碎片 */
  addFragments(data: any): Promise<qzyLotteryItem> {
    return ajax.post('/yswy-qingziyan-back-service/draw/addFragments', data)
  },
  //**用户列表 */
  getQzyUserList(data: any): Promise<any> {
    return ajax.post('/yswy-qingziyan-back-service/member/findMember', data)
  },
  //**素材列表 */
  getQzySourceMaterialList(data: any): Promise<any> {
    return ajax.post('/yswy-qingziyan-back-service/member/findImg', data)
  },
  //**兑换订单列表 */
  getQzyorderlList(data: any): Promise<any> {
    return ajax.post('/yswy-qingziyan-back-service/draw/findOrder', data)
  },
  //**订单详情 */
  qzyOrderlDetail(orderNo: any): Promise<any> {
    return ajax.post('/yswy-qingziyan-back-service/draw/getOrderDetail', {
      orderNo
    })
  },
  //**任务-概率-规则设定页面 */
  drawSetting(data: any): Promise<any> {
    return ajax.post('/yswy-qingziyan-back-service/draw/drawSetting', data)
  },
  //**任务-概率-规则设定页面详情 */
  drawSettingDetail(): Promise<any> {
    return ajax.post('/yswy-qingziyan-back-service/draw/drawSettingDetail')
  },
  //**结束进行中的抽奖概率 */
  finishDrawActivity(data: any): Promise<any> {
    return ajax.post(
      '/yswy-qingziyan-back-service/draw/finishDrawActivity',
      data
    )
  },
  //**物流详情 */
  getLogisticsDetails(data: any): Promise<any> {
    return ajax.post('/yswy-qingziyan-back-service/draw/transit', data)
  },

  //**编辑周报 */
  editReport(data: any): Promise<any> {
    return ajax.post(
      '/yswy-qingziyan-back-service/report/editReportSetup',
      data
    )
  },
  //**周报详情 */
  getReportDetai(): Promise<any> {
    return ajax.post('/yswy-qingziyan-back-service/report/getReportSetup')
  },

  //**组合套装列表 */
  getQzyCombinationList(data: any): Promise<any> {
    return ajax.post(
      '/yswy-qingziyan-back-service/combination/findCombination',
      data
    )
  },
  //**编辑组合套装 */
  editQzyCombination(data: any): Promise<any> {
    return ajax.post(
      '/yswy-qingziyan-back-service/combination/editCombination',
      data
    )
  },
  //**新建组合套装 */
  createQzyCombination(data: any): Promise<any> {
    return ajax.post(
      '/yswy-qingziyan-back-service/combination/createCombination',
      data
    )
  },
  //**新建组合套装 */
  qzyCombinationDetail(data: any): Promise<any> {
    return ajax.post(
      '/yswy-qingziyan-back-service/combination/getCombination',
      data
    )
  },
  //**组合套装上下架*/
  qzyOpeCombination(data: any): Promise<any> {
    return ajax.post(
      '/yswy-qingziyan-back-service/combination/opeCombination',
      data
    )
  },
  //**编辑顶部Banner */
  editQzyTopBanner(data: any): Promise<any> {
    return ajax.post('/yswy-qingziyan-back-service/banner/editBanner', data)
  },
  //**顶部Banner列表*/
  getQzyTopBannerList(): Promise<any> {
    return ajax.post('/yswy-qingziyan-back-service/banner/findBanner')
  },
  //**资讯连接详情*/
  getQzyConsultation(): Promise<any> {
    return ajax.post('/yswy-qingziyan-back-service/banner/getConsultation')
  },
  //**新增海报*/
  addQzyPoster(data: any): Promise<any> {
    return ajax.post('/yswy-qingziyan-back-service/banner/addPoster', data)
  },
  //**查询海报*/
  findQzyPoster(data: any): Promise<any> {
    return ajax.post('/yswy-qingziyan-back-service/banner/findPoster', data)
  },
  //**删除海报*/
  deleteQzyPoster(data: any): Promise<any> {
    return ajax.post('/yswy-qingziyan-back-service/banner/deletePoster', data)
  },
  //**编辑海报*/
  editQzyPoster(data: any): Promise<any> {
    return ajax.post('/yswy-qingziyan-back-service/banner/editPoster', data)
  }
}
